putFragment

open fun putFragment(@NonNull bundle: Bundle, @NonNull key: String, @NonNull fragment: Fragment)(source)

Put a reference to a fragment in a Bundle. This Bundle can be persisted as saved state, and when later restoring getFragment will return the current instance of the same fragment.

Parameters

bundle

The bundle in which to put the fragment reference.

key

The name of the entry in the bundle.

fragment

The Fragment whose reference is to be stored.